﻿<!DOCTYPE HTML>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta content="yes" name="apple-mobile-web-app-capable">
    <meta content="black" name="apple-mobile-web-app-status-bar-style">
    <meta content="telephone=no" name="format-detection" />
    <title>每日业绩报表</title>
    <!--使用phonegap框架时引入脚本一定要放在最上面----->
    <script type="text/javascript" charset="utf-8" src="js/phonegap-1.4.1.js"></script>
    <script src="js/jquery/jquery-1.8.1.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/config.js" type="text/javascript" charset="utf-8"></script>
    <link href="css/style.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/btnsty.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/editform.css?12" rel="stylesheet" type="text/css" charset="utf-8" />
    <link href="css/global.css" rel="stylesheet" type="text/css" charset="utf-8" />
    <script src="js/Toast.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8" src="js/barcodescanner.js"></script>
    <script src="js/laydate.js" type="text/javascript"></script>
    <script src="js/Gvtools.js" type="text/javascript"></script>
    <script type="text/javascript" charset="utf-8">
        $(function () {
            GetStockList();
            laydate.skin('molv'); //切换皮肤，请查看skins下面皮肤库
            $("#txtdate").val(today);
            $(".q-btn").live("click", function () {
                QureryData();
            });
            SetGvFloat("mytab");
        });
        function GetStockList() {
            USER_ID = localStorage.getItem("UserID");
            $.ajax({
                url: url_path + "/ajaxdata/Default.aspx",
                type: "POST",
                data: { aciton: 'GetShopList', userid: USER_ID },
                timeout: 30000,
                dataType: "text",
                success: function (data) {
                    var msg = $.trim(data);
                    if (msg == "NO_DATA") {
                        alert("您没有任何店仓权限，请联系管理员！");
                    } else {
                        var orderObj = JSON.parse(msg);
                        var html = "<option value='0'>全部</option>";
                        for (var i = 0; i < orderObj.length; i++) {
                            html += '<option value="' + orderObj[i].shopid + '">' + orderObj[i].shopname + '</option>'
                        }
                        $("#shoplist").html(html);
                        $("#shoplist").selectindex = 0;
                    }
                },
                error: function () {
                    showtoast("通讯超时,请检查网络.", null, 100, 100);
                }
            });
        }
        function QureryData() {
            $("#loading-mask").show();
            $.ajax({
                url: url_path + "/ajaxdata/Default.aspx",
                type: "POST",
                data: { aciton: 'KM_DailyPayAmt_rpt', sdate: $("#txtdate").val(), shopid: $("#shoplist option:checked").val() },
                timeout: 30000,
                dataType: "text",
                success: function (data) {
                    var msg = $.trim(data);
                    if (msg == "NO_DATA") {
                        showtoast("没有数据显示!", null, null, null);
                    } else {
                        var orderObj = JSON.parse(msg);
                        var html = "";
                        for (var i = 0; i < orderObj.length; i++) {
                            html += '<tr>'
                                    + '<td>' + orderObj[i].orderid + '</td>'
                                    + '<td>' + orderObj[i].shopname + '</td>'
                                    + '<td>' + orderObj[i].payamt + '</td>'
                                    + '<td>' + orderObj[i].upayamt + '</td>'
                                    + '<td>' + orderObj[i].kdjrate + '</td>'
                                    + '<td>' + orderObj[i].kdj + '</td>'
                                    + '<td>' + orderObj[i].allpayamt + '</td>'
                                    + '<td>' + orderObj[i].targetmoney + '</td>'
                                    + '<td>' + orderObj[i].wcl + '</td>'
                                    + '<td>' + orderObj[i].mrate + '</td>'
                                  + '</tr>'
                        }
                        $("#rptdata").html(html);
                        $("#loading-mask").hide();
                    }
                },
                error: function () {
                    $("#loading-mask").hide();
                    showtoast("通讯超时,请检查网络.", null, 100, 100);
                }
            });
        }
    </script>
</head>
<body>
    <div id="header" class="head">
        <div class="wrap">
            <i class=" menu_back2"><a href="index.html"></a></i>
            <div class="title">
                <span class="title_d">
                    <p>
                        每日业绩报表</p>
                </span>
                <div class="clear">
                </div>
            </div>
        </div>
        <div class="logo_msk">
        </div>
    </div>
    <div style="border: 1px solid #DEE1E6; bottom: 0px; position: absolute; top: 50px;
        left: 0px; right: 0px; padding: 2px;">
        <div id="oct" style="background: #fff; height: 100%; width: 100%; overflow: auto;">
            <div style="position: relative; width: 100%; height: 35px;">
                <div class="fl">
                    日期：<input class="laydate-icon" id="txtdate" value="" onclick="laydate({ elem: '#txtdate' });"></div>
                <div class="fl">
                    店铺：<select class="ipt select" id="shoplist">
                        <option value="0">全部</option>
                    </select>
                    <a class="q-btn" href="#">查询</a>
                </div>
            </div>
            <div style="height: 100%; width: 100%;">
                <table id="mytab" class="tb">
                    <thead>
                        <tr>
                            <th style="width: 80px;">
                                排名
                            </th>
                            <th style="width: 250px;">
                                店铺名称
                            </th>
                            <th style="width: 150px;">
                                当日业绩（元）
                            </th>
                            <th style="width: 150px;">
                                上周同比
                            </th>
                            <th style="width: 80px;">
                                连带率
                            </th>
                            <th style="width: 80px;">
                                客单价
                            </th>
                            <th style="width: 100px;">
                                本月业绩
                            </th>
                            <th style="width: 100px;">
                                目标业绩
                            </th>
                            <th style="width: 60px;">
                                完成率
                            </th>
                            <th style="width: 60px;">
                                时间比
                            </th>
                        </tr>
                    </thead>
                    <tbody id="rptdata">
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div id='loading-mask'>
        <div id="loading">
            <div class="loading-indicator">
                <img src="images/0504317.gif" width="48" height="48" />
                <br />
                <span id="loading-msg">数据加载中...</span>
            </div>
        </div>
    </div>
</body>
</html>
